<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    {#      图标位置#}
    {#    <link rel="icon" href="../../favicon.ico">#}
    <title>Basic</title>
    <!-- Bootstrap core CSS -->
    <link href="/static/bootstrap-3.3/css/bootstrap.css" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="/static/bootstrap-3.3/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="/static/bootstrap-3.3/css/dashboard.css" rel="stylesheet">

    <!-- loading_css -->
    <link href="/static/loading_css.css" rel="stylesheet">
    <link href="/static/loading_css_2.css" rel="stylesheet">
    <link href="/static/loading_css_tea.css" rel="stylesheet">
    <script src="/static/jquery-1.12.4.js"></script>
    <script>window.jQuery || document.write('<script src="/static/jquery-1.12.4.js""><\/script>')</script>
    <script src="/static/bootstrap-3.3/js/bootstrap.js"></script>
    <!-- Just to make our placeholder images work. Don't actually copy the next line! -->
    <script src="/static/bootstrap-3.3/js/holder.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="/static/bootstrap-3.3/js/ie10-viewport-bug-workaround.js"></script>
    {% block link_script %}
    {% endblock %}
    {% block style %}
    {% endblock %}
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    {#<nav class="blog-masthead">#}
    <div class="container">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">后台管理</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <a class="navbar-brand navbar-right" href="/basic_app/logout">注销</a>
            <a class="navbar-brand navbar-right">{{ request.session.username }}</a>
            <a class="navbar-brand navbar-right">你好，</a>
        </div><!--/.navbar-collapse -->
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar aaaa">
            <ul class="nav nav-sidebar" id="tag_id">
                {% block tag_left %}
                {% endblock %}
            </ul>
        </div>
        {% block userinfo %}
        {% endblock %}
    </div>
</div>
<!--loading特效-->
{#<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">#}
{#    <div style="width: 250px;height:150px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">#}
{#        　　#}
{#        <div class="cssload-thecube">#}
{#            <span>执行中，请稍等。。。</span>#}
{#            <div class="cssload-cube cssload-c1"></div>#}
{#            <div class="cssload-cube cssload-c2"></div>#}
{#            <div class="cssload-cube cssload-c4"></div>#}
{#            <div class="cssload-cube cssload-c3"></div>#}
{#        </div>#}
{#    </div>#}
{#</div>#}
<!--倒茶loading特效-->
<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
    {#    <div class="wrapper">#}
    <div class="press">
        <div class="holder"></div>
        <div class="lid"></div>
        <div class="carafe">
            <div class="drop"></div>
            <div class="spout"></div>
            <div class="contents">
                <div class="grounds"></div>
                <div class="water"></div>
            </div>
        </div>
        <div class="plunger">
            <div class="shaft">
                <div class="knob"></div>
            </div>
            <div class="filter"></div>
        </div>
    </div>
</div>
{#</div>#}
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

{#<script>#}
{#     $(document).ready(function(){#}
{#              var test_url = window.location.href;//获取到当前页面的href#}
{#                      console.log(test_url);#}
{#        //循环遍历点击的元素 a#}
{#                 document.getElementById(tag_id).children.each(function(){#}
{#                     var url = $(this).attr('href');#}
{#var url_lower = url.toLowerCase()#}
{#                      console.log(url);#}
{#//在循环遍历中比对，如果找到了与当前页面相同的href就给当前添加class#}
{#                     var search_result= test_url.search(url)#}
{#                     console.log(search_result);#}
{#                     if(search_result != -1){#}
{#                         $(this).addClass('active');#}
{#                     }#}
{#                 })#}
{#         })#}
{##}
{#</script>#}
<script>
    //模态框居中
    $("#myModal").on('show.bs.modal', function () {
        modalResize();
    })
    $(window).resize(function () {
        modalResize();
    })

    function modalResize() {
        var winWidth = $(document.body).width();
        var modalWidth = $("#docModalContent").width();
        var width = (winWidth - modalWidth) / 2 + "px"
        console.log('modalResize:', winWidth, modalWidth, width)
        $("#myModal").find(".modal-dialog").css({
            'margin-left': width
        });
    }


    //展示loading框
    showLoading = function () {
        $('#loadingModal').modal({backdrop: 'static', keyboard: false});
    }
    //隐藏掉loading框
    hideLoading = function () {
        $('#loadingModal').modal('hide');
    }
    $(document).ready(function () {
        var local = window.location.href;
        var tda = $('.aaaa li a');
        {#console.log(tda)#}
        for (i = 0; i < tda.length; i++) {
            var search_result = local.toLowerCase().search(tda[i].href.toLowerCase())
            {#console.log(search_result)#}
            if (search_result != -1) {
                tda[i].parentElement.className = "active";//如果当前地址和菜单栏的某个栏目地址相等，则用到样式cur
            }
        }
    })

    //开启提示框
    $('[data-toggle="tooltip"]').tooltip();
</script>
{% block script %}
{% endblock %}
</body>

</html>
